home *** CD-ROM | disk | FTP | other *** search
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.midlet.MIDlet;
-
- public class Hello extends MIDlet implements CommandListener {
- static final String EXIT_COMMAND_LABEL = "Exit hello world";
- static final String AGAIN_COMMAND_LABEL = "Again, again ...";
- Display display;
- static Hello hello;
-
- protected void destroyApp(boolean var1) {
- this.display.setCurrent((Displayable)null);
- ((MIDlet)this).notifyDestroyed();
- }
-
- protected void pauseApp() {
- }
-
- protected void startApp() {
- HelloCanvas var1 = new HelloCanvas();
- this.display = Display.getDisplay(this);
- Command var2 = new Command("Exit hello world", 1, 0);
- Command var3 = new Command("Again, again ...", 1, 1);
- ((Displayable)var1).addCommand(var2);
- ((Displayable)var1).addCommand(var3);
- ((Displayable)var1).setCommandListener(this);
- this.display.setCurrent(var1);
- }
-
- public void commandAction(Command var1, Displayable var2) {
- String var3 = var1.getLabel();
- if (var3 == "Exit hello world") {
- this.destroyApp(false);
- } else if (var3 == "Again, again ...") {
- }
-
- }
- }
-